<!---
To do:
Currently is only using CF client-side validation without rules for Workshop_Date, Start_Time, End_Time and requirements for input when descriptions are selected (offline reasons other, alt_languages, etc..)
Need to block workshops that don't belong to Regional Admins, Organizers and Site Contacts by filtering on organizationID
Need method to add sites, organizers and managers if none are associated with organization
Need to add hide/show toggle for offline reasons "Other"
Move workshopHolidays to database....this will expire after the 2012-2013 workshop season
Fix toggle on offline reason other option to show/hide other box.
Fix toggle on Online to clear all offline reasons when checked
Need cross-organization permissions...big  consider different options...if a get call doesn't find an object, it returns an error, so maybe query first with Organization_ID to see if recordcount > 0, then get??
--->
<cfparam name="Workshop_ID" type="integer" default="0" />
<cfparam name="Organization_ID" type="integer" default="0" />
<cfparam name="returnView" type="string" default="workshops" />
<cfparam name="passback" type="string" default="" />

<cfscript>
	workshopGateway = new assets.calgrants.com.gateway.WorkshopGateway();
	workshop = workshopGateway.get(Workshop_ID = Workshop_ID, Organization_ID = IIf(IsUserInRole("Organizer") OR IsUserInRole("Site Contact"), request.authUser.organizationID, ""));
	if (workshop.getWorkshop_ID() eq 0 AND request.authUser.organizationID gt 0) {
		workshop.setOrganization_ID(request.authUser.organizationID);
	} else if (Organization_ID gt 0) {
		workshop.setOrganization_ID(Organization_ID);
	}
</cfscript>

<cfif workshop.getOrganization_ID() eq 0>
	
	<cfset returnView = "editWorkshop" />
	<cfset cancelView = "workshops" />
	<cfset passback = "Workshop_ID,0" />
	<cfinclude template="/assets/calgrants/ui/forms/selectOrganization.cfm">

<cfelseif workshop.getOrganization_ID() gt 0 and IsNumeric(workshop.getWorkshop_ID())>

	<cfscript>
		base = new assets.calgrants.com.Base();
		passbackQueryString = base.passbackToQueryString(passback);
		offlineReasons = base.getOfflineReasons();
		organizationGateway = new assets.calgrants.com.gateway.OrganizationGateway();
		organization = organizationGateway.get(Organization_ID = workshop.getOrganization_ID());
		organizations = organizationGateway.query(regionIDs = IIf(IsUserInRole("Regional Admin"), request.authUser.regionID, ""), Organization_ID = IIf(IsUserInRole("Organizer") OR IsUserInRole("Site Contact"), workshop.getOrganization_ID(), ""));
		siteGateway = new assets.calgrants.com.gateway.SiteGateway();
		sites = siteGateway.query(Organization_ID = workshop.getOrganization_ID());
		userGateway = new assets.calgrants.com.gateway.UserGateway();
		organizers = userGateway.query(Organization_ID = IIf(IsUserInRole("Organizer") OR IsUserInRole("Site Contact"), workshop.getOrganization_ID(), ""), Role = "Organizer", Archived = 0);
		managers = userGateway.query(Organization_ID = IIf(IsUserInRole("Organizer") OR IsUserInRole("Site Contact"), workshop.getOrganization_ID(), ""), roles = "Site Contact,Organizer", Archived = 0);
		if (workshop.getWorkshop_ID() eq 0) {
			workshop.setEvaluation_Code(base.genEvaluationCode());
			workshop.setProgram_Year(request.currentProgramYear);
		} else {
			jsMonth = Month(workshop.getWorkshop_Date()) - 1;
		}
	</cfscript>

	<script type="text/javascript" language="javascript">
	<!--
		<cfoutput>
			var workshopID = #workshop.getWorkshop_ID()#;
			var organizationID = #workshop.getOrganization_ID()#;
			<cfif workshop.getWorkshop_ID() gt 0>
				var jsMonth = #Month(workshop.getWorkshop_Date())# - 1;
				var workshopDate = new Date(#Year(workshop.getWorkshop_Date())#,jsMonth,#Day(workshop.getWorkshop_Date())#,1,1,1);
				var startTime = new Date(2000,10,10,#Hour(workshop.getStart_Time())#,#Minute(workshop.getStart_Time())#,1);
				var endTime = new Date(2000,10,10,#Hour(workshop.getEnd_Time())#,#Minute(workshop.getEnd_Time())#,1);
			<cfelse>
				var workshopDate = "";
				var startTime = "";
				var endTime = "";
			</cfif>
			var siteID = #workshop.getSite_ID()#;
			var organizerID = #workshop.getOrganizer_ID()#;
			var managerID = #workshop.getManager_ID()#;
			var organizations = new kendo.data.DataSource();
			organizations.data(#SerializeJSON(base.QueryToStruct(organizations), false)#);
			var sites = new kendo.data.DataSource();
			sites.data(#SerializeJSON(base.QueryToStruct(sites), false)#);
			var organizers = new kendo.data.DataSource();
			organizers.data(#SerializeJSON(base.QueryToStruct(organizers), false)#);
			var managers = new kendo.data.DataSource();
			managers.data(#SerializeJSON(base.QueryToStruct(managers), false)#);
			//var workshopYear = #ListLast(request.currentProgramYear, "-")#;
			var workshopYear = workshopID == 0 ? #ListLast(request.currentProgramYear, "-")# : #ListLast(workshop.getProgram_Year(), "-")#
			var workshopHolidays = #SerializeJSON(base.getWorkshopHolidays(), false)#;
		</cfoutput>
		
		toggle = function(sel) {
			if (sel == "Online") {
				if ($("#Online").is(":checked")) {
					$("#offlineReasonsContainer").hide();
				} else {
					$("#offlineReasonsContainer").show();
				}
			} else if (sel == "Alt_Language_Workshop") {
				if ($("#Alt_Language_Workshop").is(":checked")) {
					$("#altLanguagesContainer").show();
				} else {
					$("#altLanguagesContainer").hide();
					$("#Alt_Languages").val("");
				}
			} else if (sel == "Translators") {
				if ($("#Translators").is(":checked")) {
					$("#translatorLanguagesContainer").show();
				} else {
					$("#translatorLanguagesContainer").hide();
					$("#Translator_Languages").val("");
				}
			} else if (sel == "Other_Services") {
				if ($("#Other_Services").is(":checked")) {
					$("#otherServicesDescriptionContainer").show();
				} else {
					$("#otherServicesDescriptionContainer").hide();
					$("#Other_Services_Description").val("");
				}
			} else if (sel == "offlineReasonOther") {
				if ($("#offlineReasonOther").is(":checked")) {
					$("#offlineReasonsOther").show();
				} else {
					$("#offlineReasonsOther").hide();
					$("#offlineReasonsOther").val("");
				}
			}
		}
		validate = function() {
			var isValid = true;
			var errorMessages = [];
			var wd = checkWorkshopDate();
			if (!wd.isValid) {
				isValid = false;
				var l = wd.errors.length - 1;
				for (var e=l; e>=0; e--) {
					errorMessages.unshift(wd.errors[e]);
				}
			}
			var wt = checkWorkshopTimes();
			if (!wt.isValid) {
				isValid = false;
				var l = wt.errors.length - 1;
				for (var e=l; e>=0; e--) {
					errorMessages.unshift(wt.errors[e]);
				}
			}
			var anticipatedStudents = $("#Anticipated_Students").val();
			var anticipatedVolunteers = $("#Anticipated_Volunteers").val();
			var anticipatedComputers = $("#Anticipated_Computers").val();
			var intRegex = /^\d+$/;
			if (!intRegex.test(anticipatedStudents)) {
				isValid = false;
				errorMessages.push("Anticipated number of students is required and must be a number greater than or equal to 10");
			} else {
				if (anticipatedStudents < 10) {
					isValid = false;
					errorMessages.push("Anticipated number of students must be equal to or greater than 10");	
				}
			}
			if (!intRegex.test(anticipatedVolunteers)) {
				isValid = false;
				errorMessages.push("Anticipated number of volunteers is required and must be a number");
			}
			if (!intRegex.test(anticipatedComputers)) {
				isValid = false;
				errorMessages.push("Anticipated number of computers is required and must be a number");
			}
			if (!$("#Online").is(":checked")) {
				isValid = false;
				errorMessages.push("Computer lab access to complete the online FAFSA or CA Dream Act Application is required. If your workshop does not offer computer access contact cashforcollege@csac.ca.gov.");
			}
			if ($("#Alt_Language_Workshop").is(":checked")) {
				if ($("#Alt_Languages").val().length == 0) {
					isValid = false;
					errorMessages.push("List alternate language workshop languages");
				}
			}
			if ($("#Translators").is(":checked")) {
				if ($("#Translator_Languages").val().length == 0) {
					isValid = false;
					errorMessages.push("List the translator languages");
				}
			}
			if ($("#Other_Services").is(":checked")) {
				if ($("#Other_Services_Description").val().length == 0) {
					isValid = false;
					errorMessages.push("List the other services");
				}
			}
			if (errorMessages.length > 0) {
				var errorMessage = "";
				for (var i=0; i<errorMessages.length; i++) {
					errorMessage += errorMessages[i] + "\n";	
				}
				alert(errorMessage);
			}
			return isValid;				
		}
		spotValidateWorkshopDate = function() {
			var isValid = true;
			var errorMessages = [];
			var wd = checkWorkshopDate();
			if (wd.errors.length > 0) {
				isValid = false;
				var l = wd.errors.length - 1;
				for (var e=l; e>=0; e--) {
					errorMessages.unshift(wd.errors[e]);
				}
				//console.log(wdCheck);
			}
			if (errorMessages.length > 0) {
				var errorMessage = "";
				for (var i=0; i<errorMessages.length; i++) {
					errorMessage += errorMessages[i] + "\n";	
				}
				alert(errorMessage);
			}
		}
		spotValidateWorkshopTime = function() {
			var isValid = true;
			var errorMessages = [];
			var wt = checkWorkshopTimes();
			if (wt.errors.length > 0) {
				isValid = false;
				var l = wt.errors.length - 1;
				for (var e=l; e>=0; e--) {
					errorMessages.unshift(wt.errors[e]);
				}
				//console.log(wdCheck);
			}
			if (errorMessages.length > 0) {
				var errorMessage = "";
				for (var i=0; i<errorMessages.length; i++) {
					errorMessage += errorMessages[i] + "\n";	
				}
				alert(errorMessage);
			}
		}
		editSite = function() {
			window.location = "?view=editSite&returnView=editWorkshop&Site_ID=" + $("#Site_ID").val() + "&passback=Workshop_ID," + $("#Workshop_ID").val();
		}
		createSite = function() {
			window.location = "?view=editSite&returnView=editWorkshop&Site_ID=0" + "&passback=Workshop_ID," + $("#Workshop_ID").val();
		}
		editOrganizer = function() {
			window.location = "?view=editUser&returnView=editWorkshop&User_ID=" + $("#Organizer_ID").val() + "&passback=Workshop_ID," + $("#Workshop_ID").val();
		}
		createOrganizer = function() {
			window.location = "?view=editUser&returnView=editWorkshop&User_ID=0" + "&passback=Workshop_ID," + $("#Workshop_ID").val();
		}
		editManager = function() {
			window.location = "?view=editUser&returnView=editWorkshop&User_ID=" + $("#Manager_ID").val() + "&passback=Workshop_ID," + $("#Workshop_ID").val();
		}
		createManager = function() {
			window.location = "?view=editUser&returnView=editWorkshop&User_ID=0" + "&passback=Workshop_ID," + $("#Workshop_ID").val();
		}
		checkWorkshopDate = function() {
			var ret = {};
			ret.isValid = true;
			ret.errors = [];
			ret.data = "";
			//workshopDatePicker.close();
			var wd = kendo.parseDate($("#Workshop_Date").val());
			if (wd) {
				var h = checkHoliday(wd);
				if (h) {
					if (h.forbid == "dreamAct") {
						ret.errors.push("Consider an alternate workshop date as the 2014-2015 California Dream Act Application will not be available online until Monday, January 6");
					} else if (h.forbid) {
						ret.isValid = false;
						ret.errors.push("Workshops cannot be scheduled on " + h.holiday + " \(" + h.name + "\)");
						workshopDatePicker.value("");
					} else {
						ret.errors.push(h.holiday + " is " + h.name + " \- consider an alternate workshop date");
					}
				}
				var dow = wd.getDay();
				// weekday
				if (dow > 0 && dow < 6) {
					startTimePicker.min(new Date(2000, 10, 10, 12, 0, 0));
					endTimePicker.min(new Date(2000, 10, 10, 13, 0, 0));
				// weekend
				} else {
					startTimePicker.min(new Date(2000, 10, 10, 8, 0, 0));
					endTimePicker.min(new Date(2000, 10, 10, 9, 0, 0));
				}
			}
			return ret;
		}
		checkWorkshopTimes = function() {
			var ret = {};
			ret.isValid = true;
			ret.errors = [];
			ret.data = "";
			var wd = kendo.parseDate($("#Workshop_Date").val());
			var st = kendo.parseDate($("#Start_Time").val());
			var et = kendo.parseDate($("#End_Time").val());
			if (wd) {
				var dow = wd.getDay();
				// weekday
				if (dow > 0 && dow < 6) {
					if (st) {
						if (st.getHours() < 12) {
							startTimePicker.value("");
							ret.isValid = false;
							ret.errors.push("Workshops must start on or after 12\:00 PM \(noon\) on weekdays");
						}
					}
					if (et) {
						if (et.getHours() < 13) {
							endTimePicker.value("");
							ret.isValid = false;
							ret.errors.push("Workshops must end on or after 1:00 PM on weekdays");
						}
					}
				// weekend
				} else {
					if (st) {
						if (st.getHours() < 8) {
							startTimePicker.value("");
							ret.isValid = false;
							ret.errors.push("Workshops must start on or after 8:00 AM on weekends");
						}
					}
					if (et) {
						if (et.getHours() < 9) {
							endTimePicker.value("");
							ret.isValid = false;
							ret.errors.push("Workshops must end on or after 9:00 AM on weekends");	
						}
					}
				}
			} else {
				if (st) {
					if (st.getHours() < 8) {
						startTimePicker.value("");
						ret.isValid = false;
						ret.errors.push("Workshops cannot start before 8:00 AM");
					} else if (st.getHours() > 21) {
						startTimePicker.value("");
						ret.isValid = false;
						ret.errors.push("Workshops cannot start after 9:00 PM");
					}
				}
				if (et) {
					if (et.getHours() < 9) {
						endTimePicker.value("");
						ret.isValid = false;
						ret.errors.push("Workshops cannot end before 9:00 AM");
					} else if (et.getHours() > 23) {
						endTimePicker.value("");
						ret.isValid = false;
						ret.errors.push("Workshops cannot end after 11:00 PM");
					}
				}
			}
			if (st && et) {
				if (st.getTime() + 3600000 > et.getTime()) {
					endTimePicker.value("");
					ret.isValid = false;
					ret.errors.push("Workshops must be at least an hour long");
				}
			}
			return ret;
		}
		checkHoliday = function(wd) {
			for (var i=0; i<workshopHolidays.length; i++) {
				if (Date.parse(wd) == Date.parse(workshopHolidays[i].holiday)) {
					return workshopHolidays[i];
					break;
				}
			}
		}
		$(function() {
			organizationDropdown = $("#Organization_ID").kendoDropDownList({
				dataTextField: "organization",
				dataValueField: "organization_id",
				dataSource: organizations,
				template: 	'<strong>${organization}</strong><br>' +
							'${address}' +
							' # if (data.city.length > 0) { # ' +
							'<br>${city}, CA ${zip_code}' +
							' # } # '
			}).data("kendoDropDownList");
			organizationDropdown.value(organizationID);
			workshopDatePicker = $("#Workshop_Date").kendoDatePicker({
				min: new Date(workshopYear, 0, 3),
				max: new Date(workshopYear, 2, 2)
			}).data("kendoDatePicker");
			workshopDatePicker.value(workshopDate);
			startTimePicker = $("#Start_Time").kendoTimePicker({
				//min: new Date(2000, 10, 10, 8, 0, 0),
				//max: new Date(2000, 10, 10, 21, 0, 0)
			}).data("kendoTimePicker");
			startTimePicker.value(startTime);
			endTimePicker = $("#End_Time").kendoTimePicker({
				//min: new Date(2000, 10, 10, 9, 0, 0),
				//max: new Date(2000, 10, 10, 23, 0, 0)
			}).data("kendoTimePicker");
			endTimePicker.value(endTime);
			siteDropDownList = $("#Site_ID").kendoDropDownList({
				dataTextField: "site",
				dataValueField: "site_id",
				dataSource: sites,
				template: 	'<strong>${site}</strong><br>' +
							'${address}<br>' +
							'${city}, CA ${zip_code}'
			}).data("kendoDropDownList");
			siteDropDownList.value(siteID);
			organizerDropDownList = $("#Organizer_ID").kendoDropDownList({
				dataTextField: "full_name",
				dataValueField: "user_id",
				dataSource: organizers,
				template: 	'<strong>${full_name}</strong><br>' +
							'${email}<br>' +
							'${phone} ${extension}'
			}).data("kendoDropDownList");
			organizerDropDownList.value(organizerID);
			managerDropDownList = $("#Manager_ID").kendoDropDownList({
				dataTextField: "full_name",
				dataValueField: "user_id",
				dataSource: managers,
				template: 	'<strong>${full_name}</strong><br>' +
							'${email}<br>' +
							'${phone} ${extension}'
			}).data("kendoDropDownList");
			managerDropDownList.value(managerID);
			var pbShippedDatePicker = $("#PB_Shipped_Date").kendoDatePicker().data("kendoDatePicker");
			if ($("#Online").is(":checked")) {
				$("#offlineReasonsContainer").hide();
			}
			if (!$("#Alt_Language_Workshop").is(":checked")) {
				$("#altLanguagesContainer").hide();
			}
			if (!$("#Translators").is(":checked")) {
				$("#translatorLanguagesContainer").hide();
			}
			if (!$("#Other_Services").is(":checked")) {
				$("#otherServicesDescriptionContainer").hide();
			}
			if (!$("#offlineReasonOther").is(":checked")) {
				$("#offlineReasonsOther").hide();
			}
			$("#Workshop_Date").on("change", spotValidateWorkshopDate);
			//$("#Start_Time").on("change", spotValidateWorkshopTime);
			//$("#End_Time").on("change", spotValidateWorkshopTime);
			$("#workshopModal").modal();
			resizeModal("workshopModal");
		})
	//-->
	</script>
	
	<cfoutput>
	
		<cfform id="workshopForm" name="workshopForm" action="#script_name#" method="post" onsubmit="return validate();">
			<cfinput type="hidden" name="action" value="saveWorkshop" />
			<cfinput type="hidden" name="view" value="#returnView#" />
			<cfinput type="hidden" name="Workshop_ID" value="#workshop.getWorkshop_ID()#" />
			<!--- <cfinput type="hidden" name="Organization_ID" value="#workshop.getOrganization_ID()#" /> --->
			<cfinput type="hidden" name="Evaluation_Code" value="#workshop.getEvaluation_Code()#" />
			<cfinput type="hidden" name="Program_Year" value="#workshop.getProgram_Year()#" />
			<cfif IsDefined("passback")>
				<cfloop index="keyValue" list="#passback#" delimiters=";">
					<cfinput type="hidden" name="#ListFirst(keyValue)#" value="#ListLast(keyValue)#" />
				</cfloop>
			</cfif>
			
			<div id="workshopModal" class="modal modal-fullscreen" data-backdrop="static">
				<div class="modal-header">
					<h3>Workshop</h3>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<div class="row-fluid">
							<div class="span4">
								<cfif workshop.getWorkshop_ID() gt 0>
									<div class="text-control">
										<label>Workshop ID</label>
										#workshop.getWorkshop_ID()#
									</div>
								</cfif>
								<cfif IsUserInRole("Super User")>
									<div class="clearfix">
										<label class="required">Status</label>
										<cfselect name="Approved" required="yes" message="Status is required" class="span9">
											<option value="0"<cfif workshop.getApproved() eq 0> selected</cfif>>Not approved</option>
											<option value="1"<cfif workshop.getApproved() eq 1> selected</cfif>>Approved</option>
										</cfselect>
									</div>
								<cfelseif workshop.getWorkshop_ID() gt 0>
									<div class="text-control clearfix">
										<label>Status</label>
										<input type="hidden" name="Approved" value="#workshop.getApproved()#" />
										<cfif workshop.getApproved() eq 1>
											Approved
										<cfelse>
											Pending Approval
										</cfif>
									</div>
								</cfif>
								<!--- <div class="text-control">
									<label>Organization</label>
										#organization.getOrganization()#
								</div> --->
								<div class="kendo-control clearfix">
									<label class="required">Organization</label>
									<cfselect name="Organization_ID" required="yes" message="Organization is required" class="span9" style="margin: 0;"></cfselect>
								</div>
								<div class="kendo-control clearfix">
									<label class="required">Date</label>
									<cfinput type="text" id="Workshop_Date" name="Workshop_Date" value="#DateFormat(workshop.getWorkshop_Date(), 'm/d/yyyy')#" required="yes" validate="date" message="Workshop Date is required and must be a valid date" style="width: 120px" />
								</div>
								<div class="kendo-control clearfix">
									<label class="required">Start Time</label>
									<cfinput type="text" id="Start_Time" name="Start_Time" value="#TimeFormat(workshop.getStart_Time(), 'h:mm tt')#" required="yes" validate="time" message="Start Time is required and must be a valid time" style="width: 120px" />
								</div>
								<div class="kendo-control clearfix">
									<label class="required">End Time</label>
									<cfinput type="text" id="End_Time" name="End_Time" value="#TimeFormat(workshop.getEnd_Time(), 'h:mm tt')#" required="yes" validate="time" message="End Time is required and must be a valid time"  style="width: 120px" />
								</div>
								<div class="kendo-control clearfix">
									<label class="required">Site</label>
									<cfinput type="text" id="Site_ID" name="Site_ID" required="yes" message="Site is required" style="width: 74.4681%" /><cfif sites.RecordCount gt 0>&nbsp;<a class="btn btn-mini" href="##" onclick="editSite(); return false;"><i class="icon-pencil"></i></a></cfif>&nbsp;<a class="btn btn-mini" href="##" onclick="createSite(); return false;"><i class="icon-plus"></i></a>
								</div>
								<div class="kendo-control clearfix">
									<label class="required">Organizer</label>
									<cfinput type="text" id="Organizer_ID" name="Organizer_ID" required="yes" message="Organizer is required" style="width: 74.4681%" /><cfif organizers.RecordCount gt 0>&nbsp;<a class="btn btn-mini" href="##" onclick="editOrganizer(); return false;"><i class="icon-pencil"></i></a></cfif>&nbsp;<a class="btn btn-mini" href="##" onclick="createOrganizer(); return false;"><i class="icon-plus"></i></a>
								</div>
								<div class="kendo-control clearfix">
									<label class="required">Site Contact</label>
									<cfinput type="text" id="Manager_ID" name="Manager_ID" required="yes" message="Site Contact is required" style="width: 74.4681%" /><cfif managers.RecordCount gt 0>&nbsp;<a class="btn btn-mini" href="##" onclick="editManager(); return false;"><i class="icon-pencil"></i></a></cfif>&nbsp;<a class="btn btn-mini" href="##" onclick="createManager(); return false;"><i class="icon-plus"></i></a>
								</div>
							</div>
							<div class="span4">
								<label class="required">Basic Services</label>
						
								<div class="well well-framed clearfix" style="line-height: 24px;">
									<label class="checkbox">
										<input id="Online" type="checkbox" name="Online" value="1" onclick="toggle('Online')"<cfif workshop.getOnline() eq 1> checked</cfif>>
										Computer lab access to complete FAFSA/CA Dream Act Application
									</label>
									<!--- <div id="offlineReasonsContainer" class="well well-framed" style="margin-bottom: 8px;">
										<label>Please indicate why you cannot have a computer-based workshop</label>
										<cfloop index="i" from="1" to="#ArrayLen(offlineReasons)#">
											<label class="checkbox">
												<input type="checkbox"<cfif ListFirst(offlineReasons[i].reason, " ") eq "Other"> id="offlineReasonOther" onclick="toggle('offlineReasonOther')"</cfif> name="Offline_Reasons" value="#offlineReasons[i].reason#"<cfif ListFind(workshop.getOffline_Reasons(), offlineReasons[i].reason) gt 0> checked</cfif>>
												#offlineReasons[i].description#
											</label>
										</cfloop>
										<cfset offlineReasonOtherDescription = "">
										<cfif ListFind(workshop.getOffline_Reasons(), "Other") eq ListLen(workshop.getOffline_Reasons()) neq "Other">
											<cfset offlineReasonOtherDescription = ListLast(workshop.getOffline_Reasons())>
										</cfif>
										<cfinput type="text" id="offlineReasonsOtherDescription" name="Offline_Reasons" value="#offlineReasonOtherDescription#" placeholder="Enter other reason(s)" class="span9">
									</div> --->
									<label class="checkbox">
										<input type="checkbox" name="FAFSA_On_The_Web" value="1"<cfif workshop.getFAFSA_On_The_Web() eq 1> checked</cfif>>
										FAFSA on the Web worksheet presentation
									</label>
									<label class="checkbox">
										<input type="checkbox" name="Financial_Aid_Presentation" value="1"<cfif workshop.getFinancial_Aid_Presentation() eq 1> checked</cfif>>
										Cal Grant &amp; other financial aid overview
									</label>
									<label class="checkbox" style="display: none;">
										<input type="checkbox" name="Small_Group" value="1"<cfif workshop.getSmall_Group() eq 1> checked</cfif>>
										One-on-one or small group assistance
									</label>
									<label class="checkbox">
										<input type="checkbox" name="AB540" value="1"<cfif workshop.getAB540() eq 1> checked</cfif>>
										AB540/CA Dream Act assistance
									</label>
								</div>
								
								<label>Additional Services</label>
								
								<div class="well well-framed clearfix" style="line-height: 24px;">
									<label class="checkbox">
										<input type="checkbox" name="Scholarship_Assistance" value="1"<cfif workshop.getScholarship_Assistance() eq 1> checked</cfif>>
										Scholarship assistance
									</label>
									<label class="checkbox">
										<input type="checkbox" id="Alt_Language_Workshop" name="Alt_Language_Workshop" value="1" onclick="toggle('Alt_Language_Workshop')"<cfif workshop.getAlt_Language_Workshop() eq 1> checked</cfif>>
										Alternate language workshop
									</label>
									<div id="altLanguagesContainer">
										<cfinput type="text" id="Alt_Languages" name="Alt_Languages" value="#workshop.getAlt_Languages()#" placeholder="Enter alternate language(s)" class="span9" />
									</div>
									<label class="checkbox">
										<input type="checkbox" id="Translators" name="Translators" value="1" onclick="toggle('Translators')"<cfif workshop.getTranslators() eq 1> checked</cfif>>
										Translators
									</label>
									<div id="translatorLanguagesContainer">
										<cfinput type="text" id="Translator_Languages" name="Translator_Languages" value="#workshop.getTranslator_Languages()#" placeholder="Enter translator language(s)" class="span9" />
									</div>
									<label class="checkbox">
										<input type="checkbox" name="Tax_Assistance" value="1"<cfif workshop.getTax_Assistance() eq 1> checked</cfif>>
										Income tax assistance
									</label>
									<label class="checkbox">
										<input type="checkbox" name="Foster_Youth" value="1"<cfif workshop.getFoster_Youth() eq 1> checked</cfif>>
										Foster youth assistance
									</label>
									<label class="checkbox">
										<input type="checkbox" name="Refreshments" value="1"<cfif workshop.getRefreshments() eq 1> checked</cfif>>
										Refreshments
									</label>
									<label class="checkbox">
										<input type="checkbox" name="Child_Care" value="1"<cfif workshop.getChild_Care() eq 1> checked</cfif>>
										Child care
									</label>
									<label class="checkbox">
										<input type="checkbox" id="Other_Services" name="Other_Services" value="1" onclick="toggle('Other_Services')"<cfif workshop.getOther_Services() eq 1> checked</cfif>>
										Other services
									</label>
									<div id="otherServicesDescriptionContainer">
										<cfinput type="text" id="Other_Services_Description" name="Other_Services_Description" value="#workshop.getOther_Services_Description()#" placeholder="Enter other services" class="span9" />
									</div>
								</div>
							</div>
							<div class="span4">
								<div class="clearfix">
									<label class="required">Anticipated number of students</label>
									<cfinput type="text" id="Anticipated_Students" name="Anticipated_Students" value="#workshop.getAnticipated_Students()#" required="yes" validate="integer" message="Anticipated number of students is required and must be a number" style="width: 80px;">
								</div>
								<div class="clearfix">
									<label class="required">Anticipated number of volunteers</label>
									<cfinput type="text" id="Anticipated_Volunteers" name="Anticipated_Volunteers" value="#workshop.getAnticipated_Volunteers()#" required="yes" validate="integer" message="Anticipated number of volunteers is required and must be a number" style="width: 80px;">
								</div>
								<div class="clearfix">
									<label class="required">Anticipated number of computers</label>
									<cfinput type="text" id="Anticipated_Computers" name="Anticipated_Computers" value="#workshop.getAnticipated_Computers()#" required="yes" validate="integer" message="Anticipated number of computers is required and must be a number" style="width: 80px;">
								</div>
								<cfif workshop.getWorkshop_ID() gt 0>
									<div class="text-control">
										<label>Wrapper Code</label>
										#workshop.getEvaluation_Code()#
									</div>
								</cfif>
								<cfif IsUserInRole("Super User")>
									<label>Paper Based Surveys</label>
									<div class="well well-framed clearfix" style="line-height: 24px;">
										<div class="clearfix">
											<label>Status</label>
											<cfselect name="PB_Survey_Count_status" required="yes" message="Status is required" class="span9">
												<option value="Uninitiated"<cfif workshop.getPB_Survey_Count_Status() eq "Uninitiated"> selected</cfif>>Uninitiated</option>
												<option value="Final"<cfif workshop.getPB_Survey_Count_Status() eq "Final"> selected</cfif>>Final</option>
											</cfselect>
										</div>
										<div class="clearfix">
											<label>Count</label>
											<cfinput type="text" name="PB_Survey_Count" value="#workshop.getPB_Survey_Count()#" required="yes" message="Paper Based Survey Count is required" validate="integer" maxlength="100" class="span9">
										</div>
										<div class="kendo-control clearfix">
											<label>Pickup Date</label>
											<cfinput type="text" id="PB_Shipped_Date" name="PB_Shipped_Date" value="#DateFormat(workshop.getPB_Shipped_Date(), 'm/d/yyyy')#" required="no" validate="date" message="Pickup Date must be a valid date" style="width: 120px" />
										</div>
										<div class="clearfix">
											<label>Notes</label>
											<textarea name="PB_Notes" class="span9">#workshop.getPB_Notes()#</textarea>
										</div>
									</div>
								</cfif>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<a href="?view=#returnView#&#passbackQueryString#" class="btn btn-success">Cancel</a>
					<button type="submit" name="saveButton" class="btn btn-success">Save</button>
				</div>
			</div>

		</cfform>
	
	</cfoutput>

<cfelse>
	<div class="alert alert-info notFound">Workshop not found</div>
</cfif>
